function [  ] = setMat( this, mat, zRowName, zColName )
% DataMatrix::setMat(dataMatrix, mat, zRowName, zColName)
% Set the member matrix $.mat$
%
% Input
% 1. mat : matrix to set in Matlab built-in double type
% 2. zRowName : nRow-by-1 char cell containing row names
% 3. zColName : nCol-by-1 char cell containing col names
%
% Output
% 1. dataMatrix
% 
% Syntax
% ~. dataMatrix.setMat();
% ~. dataMatrix.setMat(mat);
% ~. dataMatrix.setMat(mat, zRowName, zColName);
%
% Example
% ~. dataMatrix.setMat();
% ~. dataMatrix.setMat(rand(3, 4));
% ~. dataMatrix.setMat(rand(3, 4), {''}, {''});
% ~. dataMatrix.setMat(rand(1, 1), {'r1'}, {'c1'});

if nargin == 1 % dataMatrix.setMat()
    this.setMat([]);
    return
end

if nargin == 2 % dataMatrix.setMat(mat)
    this.mat = mat;
    
    this.setZRowName(':', {''});
    this.setZColName(':', {''});
    
    return
end

if nargin == 3
    error(['BatErr: Invalid `nargin`. ', ...
        'I.e., Assigning `zRowName` without assigning `zColName` ', ...
        'is NOT allowed.']);
end

if nargin == 4
    this.mat = mat;
    
    this.setZRowName(':', zRowName);
    this.setZColName(':', zColName);
    
    return
end

end
